#version 430 core
//precision highp float;

layout (location = 0) in vec3 _Position;

out vec3 v2f_RayEntry;

uniform mat4 u_ModelMatrix;
layout(std140, binding = 0) uniform u_Matrices4ProjectionWorld
{
	mat4 u_ProjectionMatrix;
	mat4 u_ViewMatrix;
};

#define BOUNDING_BOX_SIZE 2.0f

void main()
{
    gl_Position = u_ProjectionMatrix * u_ViewMatrix * u_ModelMatrix * vec4(_Position, 1.0f);

    v2f_RayEntry = vec3(_Position + BOUNDING_BOX_SIZE / 2.0f) / BOUNDING_BOX_SIZE;
}